package com.设计模式.工厂模式;

/**
 * @author Fitch
 */
public class ShapeFactory {
    public Shape getShape(String shapeType){
        if(shapeType == null){
            return  null;
        }
        if(shapeType == "rectangle"){
            return new Rectangle();
        }else if(shapeType == "square"){
            return new Square();
        }else if(shapeType =="circle"){
            return new Circle();
        }
        return null;

    }
}
